aboutsummaryrefslogtreecommitdiff
path: root/web/pw-server/src/routes/code/[bundle_id].svelte
blob: 1775ba5ea4a64ad17a8a5d39c507a1db3e53e067 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
<script lang="ts" context="module">
  import { ApiClient } from "$lib/api_client";

  export async function load({ params, fetch }) {
    const apiClient = new ApiClient(fetch);

    try {
      const code = await apiClient.getText(`/api/code/${params["bundle_id"]}`);
      return {
        props: {
          code,
        },
      };
    } catch (error) {
      return {
        status: error.status,
        error: error,
      };
    }
  }
</script>

<script lang="ts">
  export let code;
</script>

<pre class="bot-code">
  {code}
</pre>

<style lang="scss">
  .bot-code {
    margin: 24px 12px;
  }
</style>